package com.qzl.feiq.strategy.impl;

import com.qzl.feiq.annotation.ReceiveType;
import com.qzl.feiq.enu.MessageTypeEnum;
import com.qzl.feiq.message.Message;
import com.qzl.feiq.strategy.Receive;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
import com.qzl.feiq.config.StaticConfig;

@Slf4j
@ReceiveType(command = StaticConfig.IPMSG_ANSENTRY)
public class IpmsgAnsentryImpl implements Receive {
    @Override
    public void receiveMsg(Channel channel, Message oldMessage) {
        log.info("回复数据");
        Message message = new Message(oldMessage.getFromUserIp(), MessageTypeEnum.message, StaticConfig.IPMSG_RECVMSG);
        channel.writeAndFlush(message);
    }
}
